//
//  GlobalVariables.swift
//  KCB
//
//  Created by leeqb on 11/1/15.
//  Copyright © 2015 powerlee. All rights reserved.
//

/******************** 当前登录用户信息 ********************/
/*address = "";
birthday = "";
isMarried = "";
nickName = "";
photo = "http://mymost.gotoip55.com/service/img?img=null";
sex = "<null>";
sign = "";
trueName = "";
userId = 26;
userTel = 18602335806;*/

var userInfo: [NSObject : AnyObject]? {
    return DataManager.userInfo()
}

var userId: NSInteger {
    return userInfo?["userId"]?.integerValue ?? 0
}

var userSex: NSInteger {
    return userInfo?["sex"]?.integerValue ?? 0
}

var userPhoto: String {
    return userInfo?["photo"] as? String  ?? ""
}

var userNickName: String {
    return userInfo?["nickName"] as? String  ?? ""
}

var userTrueName: String {
    return userInfo?["trueName"] as? String  ?? ""
}

var userSign: String {
    return userInfo?["sign"] as? String  ?? ""
}

// 网络加载过程中的默认图片
var g_defaultImage: UIImage! {
    return UIImage(named: "image_default")!
}

// 城市列表
var cityList: [[NSObject : AnyObject]]? {
    return NSUserDefaults.standardUserDefaults().objectForKey(cityListKey) as? [[NSObject : AnyObject]]
}